﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using TSqlServer;
/// <summary>
/// TAdSetupInfo2 的摘要说明
/// </summary>
public class TAdSetupInfo2:TData
{

    //常量
  	const string CTableName="t_ad_setup_info2";
    const string CKeyName = "infoid";
    //与数据表字段对应的变量
    private string FInfoId ; 
    private string FTypeId ; 
    private string FInfoName ; 
    private string FIsShow ; 
    private decimal FOrderBy ; 
        
	public TAdSetupInfo2()
	{
		//
		// TODO: 在此处添加构造函数逻辑
		//

        FTableName = CTableName;
        FKeyName = CKeyName;
	}

    public TAdSetupInfo2(string sid)
    {
    	FTableName = CTableName;
        FKeyName = CKeyName;
        FKeyValue = sid;
    }

    public override void Select()
    {
        string strSql = GetSelectString();
        TSqlDB oDB = new TSqlDB(strSql);
        if (!oDB.EOF)
        {

            FInfoId = oDB["infoid"].ToString();
            FTypeId = oDB["typeid"].ToString();
            FInfoName = oDB["infoname"].ToString();
            FIsShow = oDB["isshow"].ToString();
            FOrderBy = oDB["orderby"].ToDecimal();
        }
        oDB.Free();
    }
    //插入新记录。
    public void Insert()
    {
        string ExSql = "'" + FInfoId + "','" + FTypeId + "','" + FInfoName + "','" + FIsShow + "','" + FOrderBy + "'";
        base.Insert(ExSql);
    }
    //更新记录。
    public void Update()
    {
        string ExSql = " typeid ='" + FTypeId + "', infoname ='" + FInfoName + "', isshow ='" + FIsShow + "', orderby ='" + FOrderBy + "'"; 
        base.Update(ExSql);
    }
    //改变状态,0=未验证,1=已通过验证
    public void Update_status()
    {
        string ExSql = "isshow=" + FIsShow.ToString(); ;
        base.Update(ExSql);
    }
    //静态，可以不用创建对象即可调用。
    public static void DeleteByID(string sID)
    {
        TData.DeleteByID(sID, CTableName, CKeyName);
    }


    public string InfoId
    {
        get
        {
            return FInfoId;
        }
        set
        {
            FInfoId = value;
        }
    }
    public string TypeId
    {
        get
        {
            return FTypeId;
        }
        set
        {
            FTypeId = value;
        }
    }
    public string InfoName
    {
        get
        {
            return FInfoName;
        }
        set
        {
            FInfoName = value;
        }
    }
    public string IsShow
    {
        get
        {
            return FIsShow;
        }
        set
        {
            FIsShow = value;
        }
    }
    public decimal OrderBy
    {
        get
        {
            return FOrderBy;
        }
        set
        {
            FOrderBy = value;
        }
    }
}
